clear all
close all

for i = 1 : 3
    for j = 1 : 3
        M(i,j) = j+(i-1)*3;
    end
end

M